package demo.serializable;

import com.alibaba.fastjson.JSON;

import java.util.Date;

/**
 * @author : GuoFei
 * @date : 2019/6/11 15:30
 */
public class TestMain {


    public static void main(String[] args) {
        User user = new User("name",new Date(),22,true);
        String str = JSON.toJSONString(user);
        System.out.println(str);

        User resUser = JSON.toJavaObject(JSON.parseObject(str), User.class);
        System.out.println(JSON.toJSONString(resUser));
    }


}
